package com.zenith.common.enumcode;

import lombok.Getter;

@Getter
public enum RedisEnum {
    USER_TOKEN("user:token:", "用户token"),
    USER_ACTIVE("user:active:", "用户活跃状态"),
    USER_STATUS("user:status:", "用户状态"),
    TOKEN_REVOKED("token:revoked:", "token撤销列表" ),
    USER_INFO_KEY("user:info:", "用户xx缓存"),
    USER_LIST_KEY("user:list:", "用户列表缓存");

    private final String key;
    private final String desc;

    RedisEnum(String key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public String getKey(Long userId) {
        return key + userId;
    }
}
